<!--  wtake-xq2.html单步浏览-->
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
	<head  th:include="inc/examHeader::header">
		</head>
		
<script th:inline="javascript"> 
/*<![CDATA[*/ 
var ss=0;
var questionSize=[[${questionSize}]];
$(function(){
	var paperId=[[${#httpServletRequest.getParameter('paperId')}]];
	var autoTime=[[${#httpServletRequest.getParameter('autoTime')}]];	
	
	if(autoTime!=null){
		 $("#yc").html(1);
	}
	$("#mkk").load("/examReport/question-step",{'paperId': paperId}); 
})  
var m1=[[${#httpServletRequest.getParameter('autoTime')}]];

if(m1!=null){
var i = m1*60*1000;
var intervalid; 
intervalid = setInterval("fun()", i); 
function fun() {
	ss++;		
	if(ss!=questionSize){
		document.getElementById("xyg").click();	
	}else{
		document.getElementById("submitExam").click();
		clearInterval(intervalid);
	}
i--; 
} 
}

var m=[[${#httpServletRequest.getParameter('totalTime')}]];
	var s = 60;
	function showtime(){
		var k=m-1;	
		if(document.getElementById('ShowDiv')==null){
			 clearInterval(settime);
		}else{
			document.getElementById('ShowDiv').innerHTML = "剩余时间 :"+k+":"+s;
		}		
		$("#spendTime").val(k);
	    s = s-1;
	    if(s==0){
	        m = m -1;
	        s = 60;
	    }
	    if(m==0){
	    	alert("考试时间到！");
	    	document.getElementById("submitExam").click();
	    	 clearInterval(settime);
	    }	
	}
	 clearInterval(settime);
	 var settime = setInterval(function(){
	    showtime();
	},1000);
	 /*]]>*/ 
</script>	
	
	<body>
	    <div class="back" onclick="location='take.html'"><img src="/images/back.png" /></div>
		<div th:include="header :: header"></div>
		<div class="header-title" th:if="${SJK.paperId!=null}">
			<span th:text="${SJK.examName}">考试1</span>
		</div>
	<div class="spare-a">
			<div class="save-bg"><a href="#" class="spare-tj" onclick="saveAnswer()" id="submitExam">提 交</a></div>
			<div class="spare-add">
				<div class="nottake-a" th:if="${SJK.paperId!=null}">
					<span th:text="'姓名：'+${session.user.userName}">总时间：60.0分钟</span>
					<span th:if="${SJK.examType=='考试试卷'}" id="totalSc" th:text="'总分：'+${SJK.totalSc}"></span>
					<span th:text="'总时间：'+${SJK.totalTime}+'分钟'"></span>
					<span id="ShowDiv"></span>
				</div>
            <div class="task-c"  id="mkk">           
            </div>
       </div>	
       </div>   
	</body>	
</html>
